'use strict';

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
  const { router, controller } = app;

  // 上传
  router.post('/api/upload/file', controller.upload.file);

  // 登录
    router.post('/api/user/login', controller.user.login);
  router.post('/api/user/register', controller.user.register);
  router.post('/api/user/password', controller.user.updatePassword);
    router.get('/api/user/list', controller.user.allList);
    router.resources('user', '/api/user', controller.user);
    router.get('/api/recharge/page', controller.recharge.index2);
    router.resources('recharge', '/api/recharge', controller.recharge);
    router.resources('user', '/api/consume', controller.consume);
    router.post('/api/admin/login', controller.admin.login);
    router.resources('admin', '/api/admin', controller.admin);
  router.resources('message', '/api/message', controller.message);
  router.get('/api/member/list', controller.member.allList);
  router.resources('member', '/api/member', controller.member);
  router.post('/api/product/createList', controller.product.createList);
  router.resources('product', '/api/product', controller.product);
  router.resources('messageProduct', '/api/messageProduct', controller.messageProduct);
  router.resources('messageProductLog', '/api/messageProductLog', controller.messageProductLog);
};
